package com.abel.bigwater.dataserver.model.h86a

import io.netty.buffer.Unpooled
import org.junit.Assert.*
import org.junit.Test
import org.slf4j.LoggerFactory

class H86ARealtimeDataTest {
    @Test
    fun testRealtime() {
        val buf = Unpooled.buffer()
        buf.writeBytes(("ST:00001; 05/01/13 10:00;P1:01234567;L1:00000200;P2:23456789;" + "\r\nL2:00000150; B4:0;A5:95.73;A6:86.42;V:7.10;H:018.\r\n").toByteArray())

        val rd = H86ARealtimeData()
        assertTrue(rd.parseBuffer(buf, true))

        lgr.info(rd.toString())
        lgr.info(rd.channelList.joinToString())
    }

    companion object {
        private val lgr = LoggerFactory.getLogger(H86ARealtimeDataTest::class.java)
    }
}